<?php
error_reporting(0);
$catid = !($_GET['catid'])?'0':intval($_GET['catid']);
if($catid=='2813'){$catid='16';}
$page = !($_GET['page'])?'0':intval($_GET['page']);
$sort=$_GET['sort'];  if($sort==''){$sort=0;}

if($sort==0){$osort="commissionNum_desc";}
else if($sort==1){$osort="commissionVolume_desc";}
else if($sort==2){$osort="price_desc";}
else if($sort==3){$osort="price_asc";}

include_once 'Taoapi.php';
		        
$Taoapi = new Taoapi;

$Taoapi->method = 'taobao.itemcats.get';
$Taoapi->parent_cid = $catid;
$Taoapi->fields = 'cid,name';
$Taoapi->setVersion(2);
$ItemcatsData = $Taoapi->Send('get','xml')->getArrayData();
$itemcats = $ItemcatsData['item_cats']['item_cat'];

$Taoapi->method = 'taobao.taobaoke.items.get';
$Taoapi->fields = 'num_iid,title,nick,pic_url,price,click_url,commission_num';
$Taoapi->nick = USERNICK;
$Taoapi->cid = $catid;
$Taoapi->sort = $osort;
$Taoapi->page_no = $page;
$Taoapi->page_size = '18';
$Taoapi->setVersion(2);
$TaobaokeData = $Taoapi->Send('get','xml')->getArrayData();
$taobaokeItem = $TaobaokeData['taobaoke_items']['taobaoke_item'];
$totalResults = $TaobaokeData['total_results'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $q; ?><?php include("title.php");?> - <?php echo iconv("GBK", "UTF-8",SITENAME); ?></title>
<meta name="keywords" content="<?php echo $q; ?> <?php include("title.php");?>" />
<meta name="description" content="<?php include("title.php");?><?php echo $q; ?>" />
<link rel="stylesheet"  href="css/base.css" type="text/css"/>
<link rel="stylesheet"  href="css/list.css" type="text/css"/>
</head>
<body>
<?php
include("header.php");
?>

<div class="path">您当前的位置: <a href="list-0-0-1.htm"><span>所有分类</span></a>
	<?php $ccc=$_GET['catid'];
    $myFile  =  file("converter.php");
    $allnum=count($myFile); 
    for ($i=1;$i<$allnum;$i++){
    $m=explode(",",$myFile[$i]);
    $xiabiao=trim($m[0]);
    $name[$xiabiao]=$m[2];
    $cat[$xiabiao][1]=$m[3];
    $cat[$xiabiao][2]=$m[4];}
    $k[0]=$cat[$ccc][0];
    $k[1]=$cat[$ccc][1];
    $k[2]=$cat[$ccc][2];
    $n_id  =explode(" ",$k[1]);
    $n_name=explode(">>",$k[2]);
    //print_r($k);
    for ($i=0;$i<count($n_id);$i++){
    if ($name[$n_id[$i]]=="null"){}
    else{echo " &gt; <a href=list-".$n_id[$i]."-0-1.htm>".$name[$n_id[$i]]."</a>";}}?>
</div>
<div class="list_l l">
    <div class="goods_sort">
    <h5><span>当前 <font style="color:#F00"><?php $ccc=$_GET['catid'];$myFile  =  file("converter.php");$allnum=count($myFile);for ($i=1;$i<$allnum;$i++){$m=explode(",",$myFile[$i]);$xiabiao=trim($m[0]);if ($xiabiao==$ccc) {echo $m[2];}}?></font> 类目下 共有<b><?php echo $totalResults;?></b>件商品。</span></h5>
    <div class="hot_sch"> 
        <ul><div class="clear"></div>        
		<?php if(empty($ItemcatsData)){ ?>
       		<li>“当前分类下无子分类”</li>
        <?php }else{foreach ($itemcats as $row){ ?>
        	<li><a href="list-<?php echo $row["cid"] ?>-0-1.htm"><?php echo $row["name"] ?></a></li>
        <?php }} ?>
        </ul>
        <div class="clear"></div> 
    </div>
</div>

<ul class="goods_menu">
    <li<?php if($sort == 0) { echo ' class="per_active"';} ?>><a href="list-<?php echo $catid; ?>-0-1.htm">销量从高到低</a></li>
    <li<?php if($sort == 1) { echo ' class="per_active"';} ?>><a href="list-<?php echo $catid; ?>-1-1.htm">人气从高到低</a></li>
    <li<?php if($sort == 2) { echo ' class="per_active"';} ?>><a href="list-<?php echo $catid; ?>-2-1.htm">价格从高到低</a></li>
    <li<?php if($sort == 3) { echo ' class="per_active"';} ?>><a href="list-<?php echo $catid; ?>-3-1.htm">价格从低到高</a></li>
</ul>

<div class="clear"></div>

<div style="margin-top: -32px;" class="quick_page">
	<div class="pages">
			<?php require_once("pages.php");    
              $page_size=18;    
              $nums=$totalResults;     
              $sub_pages=1;   
              $pageCurrent=$_GET["page"];   
              $subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,"list-".$catid."-".$sort."-",1);
            ?>
            </div>
            </div>

<div class="toolbar"><ul>
<li class='list_selected thumb-selected'><a class='thumb-mode'>大图</a></li>

<li class="order">
	<span class="title">排序：</span><select onChange="if(this.selectedIndex!=0){window.open(this.value)};this.selectedIndex=0"><option value="list-<?php echo $catid; ?>-0-1.htm">默认排序</option><option value="list-<?php echo $catid; ?>-1-1.htm">人气从高到低</option><option value="list-<?php echo $catid; ?>-3-1.htm">价格从低到高</option><option value="list-<?php echo $catid; ?>-2-1.htm">价格从高到低</option></select>
</li>
<li class='by-price'>
价格：
<a href='soso.php?catid=<?php echo $catid; ?>&pr=1.htm' >0～50元</a>
&nbsp;&nbsp;&nbsp;<a href='soso.php?catid=<?php echo $catid; ?>&sort=<?php echo $sort; ?>&pr=2.htm' >50～100元</a>
&nbsp;&nbsp;&nbsp;<a href='soso.php?catid=<?php echo $catid; ?>&sort=<?php echo $sort; ?>&pr=3.htm' >100～200元</a>
&nbsp;&nbsp;&nbsp;<a href='soso.php?catid=<?php echo $catid; ?>&sort=<?php echo $sort; ?>&pr=4.htm' >200～300元</a>
&nbsp;&nbsp;&nbsp;<a href='soso.php?catid=<?php echo $catid; ?>&sort=<?php echo $sort; ?>&pr=5.htm' >300元以上</a>
</li>
</ul>
</div>
<!--商品列表形式开始-->
<?php foreach ($taobaokeItem as $mtwitem) { ?>
<div class="list_good">
    <ul>
        <li class="list_item od_pro large">
        <div class="photo"><a href="view-<?php echo $mtwitem["num_iid"] ?>.htm" target="_blank"><img src="<?php echo $mtwitem["pic_url"] ?>_b.jpg" alt="<?php echo $mtwitem["title"] ?>"  /></a></div>
        <div class="summary"><h3><a href="view-<?php echo $mtwitem["num_iid"] ?>.htm" target="_blank"><?php echo $mtwitem["title"] ?></a></h3> 
        <div class="shop_rate">掌柜：<a href="shop-<?php echo urlencode($mtwitem["nick"]) ?>-0-1.htm" target="_blank"><?php echo $mtwitem["nick"]; ?></a></div>
        <div class="shop_url"><a href="gotoshop-<?php echo urlencode($mtwitem["nick"]) ?>.htm" target="_blank" title="进入淘宝店铺看看">去店铺看看</a></div>
        </div>
        <ul class="attribute">    
            <li class="good_price"><?php echo $mtwitem["price"] ?></li>
            <li class="good_commit"><span class="xb-return"></span><span class="xb-truth"></span></li>
            <li class="good_promotion"><?php echo $mtwitem["commission_num"]; ?></li>
            <li class="good_city"><a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&uid=<?php echo urlencode($mtwitem["nick"]); ?>&site=cntaobao&s=1&charset=utf-8" ><img src="http://amos.im.alisoft.com/online.aw?v=2&uid=<?php echo urlencode($mtwitem["nick"]); ?>&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a></li>
        </ul>
        </li>
    </ul>
</div>
<?php } ?>
<!--商品列表形式结束-->
<div class="clear"></div>
<div class="quick_page">
	<div class="pages">
    	<div class="pages">
			<?php require_once("pages.php");    
              $page_size=18;    
              $nums=$totalResults;     
              $sub_pages=8;   
              $pageCurrent=$_GET["page"];   
              $subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,"list-".$catid."-".$sort."-",2);
            ?>
		</div>
	</div>
</div>
</div>

<div class="list_r r">
<div class="imgls"><img src="images/taozhi.gif" /></div>
<div class="main_sort">
	<div class="main_sort_line"></div>
    <h3><strong>服装</strong></h3>    
        <ul>
            <li><a href="list-16-0-1.htm">精品女装/韩版/棉衣/外套</a></li>
            <li><a href="list-30-0-1.htm">男装/棉衣/羽绒服/御寒服</a></li>
            <li><a href="list-50008165-0-1.htm">童装/童鞋/哈衣/孕妇装</a></li>
            <li><a href="list-50006843-0-1.htm">女鞋/高跟鞋/拖鞋/靴子</a></li>
            <li><a href="list-50011740-0-1.htm">男鞋/皮鞋/休闲鞋</a></li>
            <li><a href="list-1625-0-1.htm">男女内衣/睡衣/黛安芬/猫人</a></li>
            <li><a href="list-50010388-0-1.htm">运动鞋/Nike/Adidas/李宁</a></li>
            <li><a href="list-50011699-0-1.htm">运动服/运动裤/运动套装</a></li>
         </ul>
    <h3><strong>美容</strong></h3>
        <ul>
            <li><a href="list-1801-0-1.htm">美容护肤/美体/精油</a></li>
            <li><a href="list-50010788-0-1.htm">彩妆/香水/美发/工具</a></li>
        </ul>
    <h3><strong>配饰</strong></h3>
        <ul>
            <li><a href="list-50006842-0-1.htm">箱包皮具/热销女包/男包</a></li>
            <li><a href="list-50013864-0-1.htm">饰品/流行首饰/时尚饰品</a></li>
            <li><a href="list-50011397-0-1.htm">珠宝/钻石/翡翠/黄金</a></li>
            <li><a href="list-50005700-0-1.htm">品牌手表/西铁城/雷达</a></li>
           	<li><a href="list-50010404-0-1.htm">服饰配件/皮带/帽子/围巾</a></li>
			<li><a href="list-28-0-1.htm">ZIPPO/瑞士军刀/眼镜</a></li>
        </ul>
    <h3><strong>母婴</strong></h3>
    <ul>
        <li><a href="list-35-0-1.htm">奶粉/尿片/母婴用品</a></li>
        <li><a href="list-50014812-0-1.htm">尿片/洗护/喂哺等用品</a></li>
        <li><a href="list-50005998-0-1.htm">益智玩具/童车/童床/书包</a></li>
    </ul>
    <h3><strong>食品</strong></h3>
    <ul>
        <li><a href="list-50002766-0-1.htm">食品/茶叶/零食/特产</a></li>
        <li><a href="list-50012472-0-1.htm">保健食品/美容/瘦身</a></li>
    </ul>
    <h3><strong>数码</strong></h3>
        <ul>
            <li><a href="list-1512-0-1.htm">手机/诺基亚</a></li>
            <li><a href="list-1101-0-1.htm">品牌笔记本电脑</a></li>
            <li><a href="list-14-0-1.htm">数码相机/摄像机/图形冲印</a></li>
            <li><a href="list-11-0-1.htm">电脑硬件/台式整机/网络设备</a></li>
            <li><a href="list-50012164-0-1.htm">闪存卡/U盘/移动存储</a></li>
            <li><a href="list-50012100-0-1.htm">家电/HiFi音箱/取暖/加湿/烟灶</a></li>
            <li><a href="list-50008090-0-1.htm">3C数码配件市场</a></li>
            <li><a href="list-1201-0-1.htm">MP3/MP4/iPod/录音笔</a></li>
        </ul>
    <h3><strong>家居</strong></h3>
    <ul>
        <li><a href="list-21-0-1.htm">居家日用/厨房餐饮</a></li>
        <li><a href="list-50008163-0-1.htm">床上用品	/地毯/布艺</a></li>
        <li><a href="list-50008164-0-1.htm">家具/家具定制/宜家代购</a></li>
        <li><a href="list-2128-0-1.htm">时尚家饰/工艺品/十字绣</a></li>
        <li><a href="list-27-0-1.htm">装潢/灯具/五金/安防</a></li>
    </ul>
    <h3><strong>文体</strong></h3>
    <ul>
        <li><a href="list-50010728-0-1.htm">运动/舞蹈/健身/羽毛球</a></li>
        <li><a href="list-2203-0-1.htm">户外/登山/野营/旅行装备</a></li>
        <li><a href="list-25-0-1.htm">玩具/模型/娃娃/人偶</a></li>
        <li><a href="list-26-0-1.htm">汽车/配件/改装/摩托/自行车</a></li>
        <li><a href="list-23-0-1.htm">古董/邮币/字画/收藏</a></li>
        <li><a href="list-33-0-1.htm">书籍/漫画/童书/考试</a></li>
        <li><a href="list-29-0-1.htm">宠物/宠物食品及用品</a></li>
        <li><a href="list-50011949-0-1.htm">折扣券/演唱会/旅游/吃喝玩乐</a></li>
    </ul>
</div>
<div class="box hot_por">
	<h3>热卖推荐</h3>
    <embed src="http://a.alimama.cn/widget/yr1/yr1fixed_160_600.swf" flashvars="catid=999900001&count=20&sz=23&type=1&i=<? echo MMPID; ?>" width="160" height="600" quality="high" wmode="transparent" bgcolor="#f6f6f6" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><br>
	<embed src="http://a.alimama.cn/widget/yr1/yr1fixed_160_600.swf" flashvars="catid=&count=20&sz=23&type=2&i=<? echo MMPID; ?>" width="160" height="600" quality="high" wmode="transparent" bgcolor="#ffffff" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</div>
</div>

<div class="clear"></div>
</div>

<?php
include("footer.php");
?>